import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public class StuID {
    public static void main(String[] args) {
        List<Stu> list = new LinkedList<Stu>();
        list.add(new Stu("20175331", "宋昌兴", 'M',
                20, 89, 88, 76));
        list.add(new Stu("20175332", "张苗", 'F',
                19, 11, 73, 99));
        list.add(new Stu("20175333", "曹雅鲲", 'M',
                20, 79, 84, 79));
        list.add(new Stu("20175334", "罗欣锐", 'M',
                19, 90, 26, 80.5));
        list.add(new Stu("20175335", "丹罗", 'M',
                20, 83, 77, 90));
        Iterator<Stu> iterator = list.iterator();
        System.out.println("排序前：");
        while (iterator.hasNext()) {
            Stu stu = iterator.next();
            System.out.println(stu.toString());
        }
        Collections.sort(list, new ComID());
        System.out.println("按照学号排序后：");
        iterator = list.iterator();
        while (iterator.hasNext()) {
            Stu stu = iterator.next();
            System.out.println(stu.toString());
        }
    }
}